class RenameAttributesToItemAttributes < ActiveRecord::Migration
  def self.up
    rename_table :attributes, :item_attributes
    rename_table :attribute_values, :item_attribute_values
    rename_table :attribute_sets, :item_attribute_sets
    
    rename_column :item_attributes, :attribute_set_id, :item_attribute_set_id
    rename_column :item_attribute_values, :attribute_id, :item_attribute_id
  end

  def self.down
    rename_column :item_attributes, :item_attribute_set_id, :attribute_set_id
    rename_column :item_attribute_values, :item_attribute_id, :attribute_id

    rename_table :item_attributes, :attributes
    rename_table :item_attribute_values, :attribute_values
    rename_table :item_attribute_sets, :attribute_sets
  end
end
